<?php

namespace Biz\model\brand;

use Doraemon\pockets\datebase\BaseDbModel;

/**
 * 品牌存根
 *
 * @category   Module name
 * @package    PSR
 * @subpackage Documentation\API
 * @author     zhouyang  <zhouyang@haohaozhu.com>
 * @license    GPL http://www.haohaozhu.com
 * @link       http://www.haohaozhu.com
 */

class BrandStub extends BaseDbModel
{
    const _CONFIG_FILE_ = 'db_store';

    const _CONFIG_SELECT_ = 'db_store';

    const _DATABASE_ = 'store';

    const _TABLE_NAME = 'brand_stub';

    const _SUB_TABLE = false;

    // 支付平台（1：支付宝；2：微信；3：银行转账）
    const PAY_PLATFORM_ALI_PAY = 1;
    const PAY_PLATFORM_WE_CHAT = 2;
    const PAY_PLATFORM_OFFLINE = 3;

    const PAY_PLATFORM = [
        self::PAY_PLATFORM_ALI_PAY => '支付宝',
        self::PAY_PLATFORM_WE_CHAT => '微信',
        self::PAY_PLATFORM_OFFLINE => '银行转账'
    ];

    public function getByCondition($condition)
    {
        return self::get('*', $condition);
    }

    public static function listByCondition($condition)
    {
        return self::select('*', $condition);
    }
}
